<%include ../../inc/header.ejs%>
<style>
    .layui-icon:hover{cursor: pointer;}
    .layui-icon{font-size: 32px; color: #1E9FFF;}
    .layui-input-block i{margin-right: 10px;}
    .hide{display: none;}
</style>
<!-- html主体代码 start -->
<fieldset class="layui-elem-field layui-field-title">
    <legend>数据管理操作</legend>
</fieldset>
<form class="layui-form" action="" id="data-form">
    <div class="layui-form-item">
        <label class="layui-form-label">真实姓名</label>
        <div class="layui-input-block">
            <input value="<% if((typeof obj)!=='undefined'){%><%=obj.trueName%><%}%>" name="trueName" id="model-trueName" type="text" required placeholder="请输入用户姓名" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">所属部门</label>
        <div class="layui-input-block">
            <select name="departmentId" lay-filter="aihao">
                <% if((typeof department)!=='undefined'){%>
                    <% department.forEach(function(bm){ %>
                        <option value="<%=bm.id%>" <% if((typeof obj)!=='undefined'){if(obj.departmentId==bm.id){%> selected <%}}%>><%=bm.name%></option>
                    <%})%>
                <%}%>
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">所属角色</label>
        <div class="layui-input-block">
            <select name="roleId" lay-filter="aihao">
                <% if((typeof role)!=='undefined'){%>
                <% role.forEach(function(js){ %>
                <option value="<%=js.id%>" <% if((typeof obj)!=='undefined'){if(obj.roleId==js.id){%> selected <%}}%>><%=js.name%></option>
                <%})%>
                <%}%>
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">状态</label>
        <div class="layui-input-block">
            <select name="status" lay-filter="aihao">
                <option value="1" <% if((typeof obj)!=='undefined'){if(obj.status==1){%>selected<%}}%>>启用</option>
                <option value="0" <% if((typeof obj)!=='undefined'){if(obj.status==0){%>selected<%}}%>>禁用</option>
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">登录名</label>
        <div class="layui-input-block">
            <input value="<% if((typeof obj)!=='undefined'){%><%=obj.userName%><%}%>" name="userName" id="model-userName" type="text"
                   required placeholder="请输入登录名" class="layui-input"
                   <% if((typeof obj)!=='undefined'){if(obj.status==1){%>disabled<%}}%>>
        </div>
    </div>
    <div class="layui-form-item <% if((typeof obj)!=='undefined'){%>hide<%}%>">
        <label class="layui-form-label">登录密码</label>
        <div class="layui-input-block">
            <input name="password" id="model-password" type="password" placeholder="请输入登录密码" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item <% if((typeof obj)!=='undefined'){%>hide<%}%>">
        <label class="layui-form-label">确认密码</label>
        <div class="layui-input-block">
            <input name="apassword" id="model-apassword" type="password" placeholder="请输入确认密码" class="layui-input">
        </div>
    </div>
</form>
<!-- html主体代码 end -->
<%include ../../inc/js.ejs%>

<!-- 私有脚本 start -->
<script>
    function getPageVal() {
        var obj = getFrom('#data-form');
        if(!autoRequired('model-',obj)){
            return false;
        }
        return obj;
    }

</script>
<!-- 私有脚本 end -->
<%include ../../inc/footer.ejs%>